<?php
/**
 * multiupd component
 * @package common_component_global
 */
load_lib('/sys/component');
/**
 * multiupd component
 * @author pandajingjing
 * @package common_component_global
 */
class global_multiupdcomponent extends sys_component{

	/**
	 * 使用的JS
	 * @return array
	 */
	static function useSScript(){
		return array_merge(parent::useSScript(),array( 
				'/global/multiupd.js' 
		));
	}

	/**
	 * 使用的JS
	 * @return array
	 */
	static function useOScript(){
		return array_merge(parent::useOScript(),array( 
				'static://script/swfupd_2.5.0_b3/upd.js' 
		));
	}

	/**
	 * 使用的样式
	 * @return array
	 */
	static function useSStyle(){
		return array_merge(parent::useSStyle(),array( 
				'/global/multiupd.css' 
		));
	}

	/**
	 * 获取UI
	 */
	function getView(){
		$arrConfig=$this->getDatas();
		load_lib('/util/url');
		$arrDefault=array( 
				'upload_url'=>get_config('upload_domain','dfs').'/upload/',
				'file_post_name'=>'file',
				'post_params'=>array(),
				'file_types'=>'*.jpg',
				'file_types_description'=>'JPG Images',
				'file_size_limit'=>'200 KB',
				'file_upload_limit'=>10,
				'file_queue_limit'=>10,
				'prevent_swf_caching'=>true,
				'button_placeholder_id'=>'upd',
				'button_image_url'=>util_url::getStaticURL('/images/global/XPButtonNoText_61x22.png'),
				'button_width'=>61,
				'button_height'=>22,
				'button_text'=>'上传',
				'button_text_style'=>'text-align:center;',
				'button_text_top_padding'=>0,
				'button_text_left_padding'=>18,
				'button_action'=>'SWFUpload.BUTTON_ACTION.SELECT_FILES',
				'button_cursor'=>'SWFUpload.CURSOR.HAND',
				'button_window_mode'=>'SWFUpload.WINDOW_MODE.TRANSPARENT',
				'custom_settings'=>array(),
				'load_error_msg'=>'加载失败',
				'queue_full_msg'=>'你只能上传多少张,已经上传多少张,只能再选择多少张',
		);
		$arrConfig=array_merge($arrDefault,$arrConfig);
		foreach($arrConfig as $strKey=>$strValue){
			$this->setData($strKey,$strValue);
		}
		return 'multiupd';
	}
}